<?php
namespace dwc_app;

class GoogleDocsAPI extends GoogleAPI
{
    static $service_name = 'writely';
    
    public function create_spreadsheet_from_csv($title, $body, $tab = false)
    {
        $mime_type = 'text/tab-separated-values';
        
        $headers = array(
            "Content-length: " . strlen($body),
            "Content-type: $mime_type",
            "GData-Version: 3.0",
            "Slug: $title",
            "Authorization: GoogleLogin auth=" . $this->auth_token . " ");
        echo http_post("https://docs.google.com/feeds/default/private/full", $body, $headers);
    }
}

?>